Skip to content

Conversation

@jcortes
Copy link
Collaborator

@jcortes jcortes commented Aug 27, 2025

WHY

Resolves #18016

Summary by CodeRabbit

  • New Features

    • Added a reusable CSV-driven batch operation for Salesforce Bulk API 2.0 with exportable summaries.
    • Added batch actions for bulk create/update of Accounts and Opportunities.
    • Added app-level endpoints to create, upload, finalize, and query bulk ingest jobs.
  • Chores

    • Salesforce REST API component version bumped to 1.8.0.
    • Multiple actions and sources received metadata version increments.

@jcortes jcortes self-assigned this Aug 27, 2025
@vercel
Copy link

vercel bot commented Aug 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Aug 29, 2025 2:12pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Aug 29, 2025 2:12pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

Walkthrough

Adds a reusable Salesforce Bulk API 2.0 batch action, four concrete batch actions (create/update for Accounts and Opportunities), four new app methods to manage Bulk Ingest jobs, bumps package version to 1.8.0, and updates version metadata across multiple actions and sources.

Changes

Cohort / File(s) Summary
Common batch operation base
components/salesforce_rest_api/actions/common/batch-operation.mjs
New reusable batch action; adds csvFilePath and syncDir props, declares required hooks getObject(), getOperation(), getSummary(), implements processBulkOperation() (create/upload/complete/poll Bulk API 2.0 job) and run() to orchestrate flow and export summary.
Concrete batch actions (Accounts / Opportunities)
components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs, components/salesforce_rest_api/actions/create-opportunities-batch/create-opportunities-batch.mjs, components/salesforce_rest_api/actions/update-accounts-batch/update-accounts-batch.mjs, components/salesforce_rest_api/actions/update-opportunities-batch/update-opportunities-batch.mjs
Four new actions that spread the common base and implement getObject(), getOperation(), and getSummary() for Account/Opportunity with insert/update operations and documentation links in descriptions.
App: Bulk ingest support
components/salesforce_rest_api/salesforce_rest_api.app.mjs
Adds createBulkJob, uploadBulkJobData, patchBulkJob, and getBulkJobInfo methods that call /jobs/ingest endpoints via existing _makeRequest.
Package metadata
components/salesforce_rest_api/package.json
Bumps package version from 1.7.0 to 1.8.0.
Version bumps (many actions/sources)
components/salesforce_rest_api/actions/*, components/salesforce_rest_api/sources/*
Numerous files updated only to increment exported action/source version fields; no logic changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Concrete Batch Action
  participant Common as Common Batch Operation
  participant App as salesforce_rest_api.app
  participant SF as Salesforce Bulk API

  User->>Action: run(csvFilePath)
  Action->>Common: run()
  Common->>Common: getObject(), getOperation(), getSummary()
  Common->>Common: getFileStream(csvFilePath) -> csvData
  Common->>App: createBulkJob({ object, operation, ... })
  App->>SF: POST /services/data/{v}/jobs/ingest
  SF-->>App: 201 Created (jobId)
  App-->>Common: jobId
  Common->>App: uploadBulkJobData({ jobId }, csvData)
  App->>SF: PUT /jobs/ingest/{jobId}/batches (text/csv)
  SF-->>App: 201 Accepted
  Common->>App: patchBulkJob({ jobId, state: "UploadComplete" })
  App->>SF: PATCH /jobs/ingest/{jobId}
  SF-->>App: 200 OK
  loop Poll until finished
    Common->>App: getBulkJobInfo({ jobId })
    App->>SF: GET /jobs/ingest/{jobId}
    SF-->>App: Job info (status)
  end
  App-->>Common: Final job info
  Common-->>Action: export("$summary"), return job info
  Action-->>User: Job info
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Assessment against linked issues

Objective Addressed Explanation
Implement batch create/update actions for Accounts and Opportunities using Salesforce Bulk API 2.0 [#18016]
Provide links to relevant Bulk API documentation in action descriptions [#18016]

Out-of-scope changes

Code Change Explanation
Version metadata bumps across many action/source files (e.g., components/salesforce_rest_api/actions/create-account/create-account.mjs) These are widespread version field increments and are unrelated to the bulk actions requested in the linked issue.
Package version bump to 1.8.0 (components/salesforce_rest_api/package.json) Release metadata change; not required to implement or validate the batch features.

Poem

I hop with keys and CSV fluff,
I stitch up rows when uploads are tough.
Jobs spun up, batches go zoom—
Accounts and Opps leave the burrow to bloom.
A rabbit cheers: bulk jobs done! 🐇📦

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch salesforce-accounts-opportunities-batch-create-update

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (10)
components/salesforce_rest_api/actions/update-accounts-batch/update-accounts-batch.mjs (1)

4-20: Updates need Id or an external ID: expose a prop and thread it to job creation.

Bulk API 2.0 update requires the Id column in CSV or the job’s externalIdFieldName. Without surfacing this, users may see failed jobs when they don’t include Id.

Proposed action-level prop (assuming common exposes/merges props) to let users specify an external ID:

 export default {
   ...common,
   key: "salesforce_rest_api-update-accounts-batch",
   name: "Update Accounts (Batch)",
   description: "Update multiple Accounts in Salesforce using Bulk API 2.0. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)",
   version: "0.0.1",
   type: "action",
+  props: {
+    ...(common.props ?? {}),
+    externalIdFieldName: {
+      type: "string",
+      label: "External ID Field (optional)",
+      description: "If set, CSV should include this column instead of Id. Used to match records during update.",
+      optional: true,
+    },
+  },
   methods: {
     getObject() {
       return "Account";
     },
     getOperation() {
       return "update";
     },
     getSummary() {
       return "Successfully updated Accounts";
     },
   },
 };

And in common/batch-operation.mjs, include externalIdFieldName when creating the job if present.

components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs (1)

3-21: LGTM; consider clarifying CSV expectations in the description.

Minor copy tweak to reduce support friction (header row, field API names).

-  description: "Create multiple Accounts in Salesforce using Bulk API 2.0. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)",
+  description: "Create multiple Accounts in Salesforce using Bulk API 2.0. CSV must include a header row with field API names. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)",
components/salesforce_rest_api/actions/update-opportunities-batch/update-opportunities-batch.mjs (1)

4-20: Expose optional external ID for updates (same rationale as Accounts).

Prevents failed jobs when Id isn’t present in CSV.

 export default {
   ...common,
   key: "salesforce_rest_api-update-opportunities-batch",
   name: "Update Opportunities (Batch)",
   description: "Update multiple Opportunities in Salesforce using Bulk API 2.0. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)",
   version: "0.0.1",
   type: "action",
+  props: {
+    ...(common.props ?? {}),
+    externalIdFieldName: {
+      type: "string",
+      label: "External ID Field (optional)",
+      description: "If set, CSV should include this column instead of Id. Used to match records during update.",
+      optional: true,
+    },
+  },
   methods: {
     getObject() {
       return "Opportunity";
     },
     getOperation() {
       return "update";
     },
     getSummary() {
       return "Successfully updated Opportunities";
     },
   },
 };

Also ensure common/batch-operation.mjs passes externalIdFieldName to the Bulk job when provided.

components/salesforce_rest_api/actions/create-opportunities-batch/create-opportunities-batch.mjs (1)

3-21: LGTM; optional doc copy improvement.

Consider noting CSV header requirement to align with Bulk 2.0 expectations.

-  description: "Create multiple Opportunities in Salesforce using Bulk API 2.0. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)",
+  description: "Create multiple Opportunities in Salesforce using Bulk API 2.0. CSV must include a header row with field API names. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)",
components/salesforce_rest_api/salesforce_rest_api.app.mjs (2)

395-403: PATCH helper: allow header overrides

Mirror the header merge pattern so callers can set Accept or custom headers.

-    patchBulkJob({
-      jobId, ...args
-    } = {}) {
-      return this._makeRequest({
-        ...args,
-        method: "PATCH",
-        url: `${this._baseApiVersionUrl()}/jobs/ingest/${jobId}`,
-      });
-    },
+    patchBulkJob({ jobId, ...args } = {}) {
+      const { headers: extraHeaders, ...rest } = args ?? {};
+      return this._makeRequest({
+        ...rest,
+        method: "PATCH",
+        url: `${this._baseApiVersionUrl()}/jobs/ingest/${jobId}`,
+        headers: {
+          ...this._makeRequestHeaders(),
+          Accept: "application/json",
+          ...extraHeaders,
+        },
+      });
+    },

404-411: Optional: expose results endpoints for better UX

Follow-ups: add helpers to fetch results files.

// Outside the changed range – add alongside getBulkJobInfo
getBulkJobSuccessfulResults({ jobId, ...args } = {}) {
  return this._makeRequest({
    ...args,
    url: `${this._baseApiVersionUrl()}/jobs/ingest/${jobId}/successfulResults`,
    headers: { ...this._makeRequestHeaders(), Accept: "text/csv" },
  });
},
getBulkJobFailedResults({ jobId, ...args } = {}) {
  return this._makeRequest({
    ...args,
    url: `${this._baseApiVersionUrl()}/jobs/ingest/${jobId}/failedResults`,
    headers: { ...this._makeRequestHeaders(), Accept: "text/csv" },
  });
},
components/salesforce_rest_api/actions/common/batch-operation.mjs (4)

8-15: Expose wait/timeout knobs for async jobs

Consider props to control polling and timeouts so actions can optionally return only after completion.

   props: {
     app,
     csvFilePath: {
       type: "string",
       label: "CSV File Path Or URL",
       description: "The path to the CSV file to process. Provide a path to a file in the `/tmp` directory (for example, `/tmp/data.csv`). If a URL is provided, the file will be downloaded to the `/tmp` directory. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_prepare_data.htm)",
     },
+    waitForCompletion: {
+      type: "boolean",
+      label: "Wait For Job Completion",
+      description: "If true, poll the job until it reaches a terminal state.",
+      optional: true,
+      default: true,
+    },
+    pollIntervalMs: {
+      type: "integer",
+      label: "Poll Interval (ms)",
+      optional: true,
+      default: 3000,
+    },
+    timeoutMs: {
+      type: "integer",
+      label: "Timeout (ms)",
+      optional: true,
+      default: 10 * 60 * 1000,
+    },
   },

59-76: Pass externalIdFieldName when provided; keep signature future-proof

Small change to propagate optional externalIdFieldName from callers (useful if you later add upsert actions).

-    const result = await processBulkOperation({
+    const result = await processBulkOperation({
       $,
       object: getObject(),
       operation: getOperation(),
       csvData,
+      // externalIdFieldName (optional): forward if derived actions provide it
+      externalIdFieldName: this.externalIdFieldName,
     });

77-79: Let summaries include job context

Pass the job info to getSummary so derived actions can include job ID/state.

-    $.export("$summary", getSummary());
+    $.export("$summary", getSummary(result));

68-69: Nit: clarify stream handling

getFileStream returns a stream; upload path already sets text/csv. No changes needed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1b4d96e and 97a2b77.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • components/salesforce_rest_api/actions/common/batch-operation.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-opportunities-batch/create-opportunities-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-accounts-batch/update-accounts-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-opportunities-batch/update-opportunities-batch.mjs (1 hunks)
  • components/salesforce_rest_api/package.json (1 hunks)
  • components/salesforce_rest_api/salesforce_rest_api.app.mjs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (4)
components/salesforce_rest_api/package.json (1)

3-3: Version bump and action key verification complete

Semver bump to 1.8.0 is appropriate for the new actions. I ran the duplicate-key check and confirmed every key: entry in components/salesforce_rest_api/actions/**/*.mjs is unique—no duplicates found. No further concerns.

components/salesforce_rest_api/actions/update-accounts-batch/update-accounts-batch.mjs (1)

4-5: Spread order is correct.

Placing ...common first ensures local keys override defaults from the base.

components/salesforce_rest_api/actions/update-opportunities-batch/update-opportunities-batch.mjs (1)

4-5: Spread precedence is correct.

Local keys override base as intended.

components/salesforce_rest_api/salesforce_rest_api.app.mjs (1)

369-381: createBulkJob: sensible defaults; passthrough looks good

Defaults (CSV/COMMA/LF) and args passthrough are fine.

@jcortes jcortes force-pushed the salesforce-accounts-opportunities-batch-create-update branch from 97a2b77 to 22e4ce2 Compare August 27, 2025 21:57
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
components/salesforce_rest_api/actions/list-email-messages/list-email-messages.mjs (1)

24-36: Fix summary typo and avoid “undefined” when caseId is not provided.

Current summary always references a Case ID and misspells “Successfully”.

Apply this diff:

   async run({ $ }) {
     const fields = (await this.salesforce.getFieldsForObjectType("EmailMessage")).map(({ name }) => name);
     let query = `SELECT ${fields.join(", ")} FROM EmailMessage`;
     if (this.caseId) {
       query += ` WHERE RelatedToId = '${this.caseId}'`;
     }

     const { records } = await this.salesforce.query({
       $,
       query,
     });
-    $.export("$summary", `Sucessfully retrieved ${records.length} email messages for case with ID ${this.caseId}`);
+    const scope = this.caseId
+      ? `for case with ID ${this.caseId}`
+      : "across all cases";
+    $.export("$summary", `Successfully retrieved ${records.length} email messages ${scope}`);
     return records;
   },
components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs (2)

3-20: Reduce duplication across batch actions with a small helper.

With four similar batch actions, consider a tiny factory to generate these modules from {object, operation, summary}, minimizing repetition and future drift.

Example helper (placed next to the common base):

+// components/salesforce_rest_api/actions/common/make-batch.mjs
+import common from "./batch-operation.mjs";
+export default ({ key, name, description, object, operation, summary, version = "0.0.1" }) => ({
+  ...common,
+  key,
+  name,
+  description,
+  version,
+  type: "action",
+  methods: {
+    getObject() { return object; },
+    getOperation() { return operation; },
+    getSummary() { return summary; },
+  },
+});

Then this file becomes:

-import common from "../common/batch-operation.mjs";
-
-export default {
-  ...common,
-  key: "salesforce_rest_api-create-accounts-batch",
-  name: "Create Accounts (Batch)",
-  description: "Create multiple Accounts in Salesforce using Bulk API 2.0. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)",
-  version: "0.0.1",
-  type: "action",
-  methods: {
-    getObject() {
-      return "Account";
-    },
-    getOperation() {
-      return "insert";
-    },
-    getSummary() {
-      return "Successfully created Accounts";
-    },
-  },
-};
+import makeBatch from "../common/make-batch.mjs";
+export default makeBatch({
+  key: "salesforce_rest_api-create-accounts-batch",
+  name: "Create Accounts (Batch)",
+  description: "Create multiple Accounts in Salesforce using Bulk API 2.0. [See the documentation](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_understanding_bulk2_ingest.htm)",
+  object: "Account",
+  operation: "insert",
+  summary: "Successfully created Accounts",
+});

10-20: Update summary to reflect job submission and surface job details

The common batch runner closes the job (setting state to “UploadComplete”) and immediately fetches job info, but it does not poll until processing is finished. As a result, the current static summary

getSummary() {
  return "Successfully created Accounts";
}

can be misleading. At minimum, update it to indicate that the insert job was submitted, and consider including the returned job ID or other metadata. Optionally, you can refactor the batch base to pass the fetched job info into getSummary(jobInfo) so that success/failure counts or final state can be surfaced once processing truly completes.

• components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs

  • Change getSummary() to accept and interpolate job details (e.g. job ID).
  • Or, for a minimal fix, update the return string:
       getSummary() {
    -    return "Successfully created Accounts";
    +    return `Successfully submitted Accounts insert job ${job.id}`;
       },

• (Optional) In components/salesforce_rest_api/actions/common/batch-operation.mjs

  • Modify the run method to pass the fetched job info into getSummary:
       const result = await processBulkOperation({ … });
    -  $.export("$summary", getSummary());
    +  $.export("$summary", getSummary(result));
  • And update the signature of getSummary in derived actions to accept jobInfo.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 97a2b77 and 22e4ce2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (55)
  • components/salesforce_rest_api/actions/add-contact-to-campaign/add-contact-to-campaign.mjs (1 hunks)
  • components/salesforce_rest_api/actions/add-lead-to-campaign/add-lead-to-campaign.mjs (1 hunks)
  • components/salesforce_rest_api/actions/common/batch-operation.mjs (1 hunks)
  • components/salesforce_rest_api/actions/convert-soap-xml-to-json/convert-soap-xml-to-json.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-account/create-account.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-attachment/create-attachment.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-campaign/create-campaign.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-case/create-case.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-casecomment/create-casecomment.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-contact/create-contact.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-content-note/create-content-note.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-event/create-event.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-lead/create-lead.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-note/create-note.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-opportunities-batch/create-opportunities-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-opportunity/create-opportunity.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-record/create-record.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-task/create-task.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-user/create-user.mjs (1 hunks)
  • components/salesforce_rest_api/actions/delete-opportunity/delete-opportunity.mjs (1 hunks)
  • components/salesforce_rest_api/actions/delete-record/delete-record.mjs (1 hunks)
  • components/salesforce_rest_api/actions/find-records/find-records.mjs (1 hunks)
  • components/salesforce_rest_api/actions/get-case/get-case.mjs (1 hunks)
  • components/salesforce_rest_api/actions/get-user/get-user.mjs (1 hunks)
  • components/salesforce_rest_api/actions/insert-blob-data/insert-blob-data.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-case-comments/list-case-comments.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-email-messages/list-email-messages.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-email-templates/list-email-templates.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-knowledge-articles/list-knowledge-articles.mjs (1 hunks)
  • components/salesforce_rest_api/actions/post-feed-to-chatter/post-feed-to-chatter.mjs (1 hunks)
  • components/salesforce_rest_api/actions/search-string/search-string.mjs (1 hunks)
  • components/salesforce_rest_api/actions/send-email/send-email.mjs (1 hunks)
  • components/salesforce_rest_api/actions/soql-search/soql-search.mjs (1 hunks)
  • components/salesforce_rest_api/actions/sosl-search/sosl-search.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-account/update-account.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-accounts-batch/update-accounts-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-contact/update-contact.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-email-template/update-email-template.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-opportunities-batch/update-opportunities-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-opportunity/update-opportunity.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-record/update-record.mjs (1 hunks)
  • components/salesforce_rest_api/actions/upsert-record/upsert-record.mjs (1 hunks)
  • components/salesforce_rest_api/package.json (1 hunks)
  • components/salesforce_rest_api/salesforce_rest_api.app.mjs (1 hunks)
  • components/salesforce_rest_api/sources/case-updated-instant/case-updated-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/email-template-updated-instant/email-template-updated-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/knowledge-article-updated-instant/knowledge-article-updated-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-outbound-message/new-outbound-message.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/record-deleted-instant/record-deleted-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/record-updated-instant/record-updated-instant.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (44)
  • components/salesforce_rest_api/actions/find-records/find-records.mjs
  • components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs
  • components/salesforce_rest_api/actions/convert-soap-xml-to-json/convert-soap-xml-to-json.mjs
  • components/salesforce_rest_api/actions/create-task/create-task.mjs
  • components/salesforce_rest_api/actions/upsert-record/upsert-record.mjs
  • components/salesforce_rest_api/actions/list-email-templates/list-email-templates.mjs
  • components/salesforce_rest_api/actions/create-lead/create-lead.mjs
  • components/salesforce_rest_api/actions/create-account/create-account.mjs
  • components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs
  • components/salesforce_rest_api/actions/create-case/create-case.mjs
  • components/salesforce_rest_api/actions/list-knowledge-articles/list-knowledge-articles.mjs
  • components/salesforce_rest_api/actions/create-contact/create-contact.mjs
  • components/salesforce_rest_api/actions/delete-record/delete-record.mjs
  • components/salesforce_rest_api/sources/knowledge-article-updated-instant/knowledge-article-updated-instant.mjs
  • components/salesforce_rest_api/actions/create-record/create-record.mjs
  • components/salesforce_rest_api/actions/update-contact/update-contact.mjs
  • components/salesforce_rest_api/actions/send-email/send-email.mjs
  • components/salesforce_rest_api/actions/add-contact-to-campaign/add-contact-to-campaign.mjs
  • components/salesforce_rest_api/sources/record-updated-instant/record-updated-instant.mjs
  • components/salesforce_rest_api/actions/update-opportunity/update-opportunity.mjs
  • components/salesforce_rest_api/actions/get-case/get-case.mjs
  • components/salesforce_rest_api/actions/create-note/create-note.mjs
  • components/salesforce_rest_api/actions/get-user/get-user.mjs
  • components/salesforce_rest_api/actions/create-campaign/create-campaign.mjs
  • components/salesforce_rest_api/actions/insert-blob-data/insert-blob-data.mjs
  • components/salesforce_rest_api/actions/update-record/update-record.mjs
  • components/salesforce_rest_api/actions/create-event/create-event.mjs
  • components/salesforce_rest_api/actions/post-feed-to-chatter/post-feed-to-chatter.mjs
  • components/salesforce_rest_api/actions/create-attachment/create-attachment.mjs
  • components/salesforce_rest_api/actions/create-opportunity/create-opportunity.mjs
  • components/salesforce_rest_api/actions/soql-search/soql-search.mjs
  • components/salesforce_rest_api/actions/update-account/update-account.mjs
  • components/salesforce_rest_api/actions/delete-opportunity/delete-opportunity.mjs
  • components/salesforce_rest_api/actions/create-user/create-user.mjs
  • components/salesforce_rest_api/sources/case-updated-instant/case-updated-instant.mjs
  • components/salesforce_rest_api/sources/record-deleted-instant/record-deleted-instant.mjs
  • components/salesforce_rest_api/sources/new-outbound-message/new-outbound-message.mjs
  • components/salesforce_rest_api/actions/list-case-comments/list-case-comments.mjs
  • components/salesforce_rest_api/actions/update-email-template/update-email-template.mjs
  • components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs
  • components/salesforce_rest_api/actions/search-string/search-string.mjs
  • components/salesforce_rest_api/actions/create-content-note/create-content-note.mjs
  • components/salesforce_rest_api/sources/email-template-updated-instant/email-template-updated-instant.mjs
  • components/salesforce_rest_api/actions/sosl-search/sosl-search.mjs
🚧 Files skipped from review as they are similar to previous changes (6)
  • components/salesforce_rest_api/package.json
  • components/salesforce_rest_api/actions/update-opportunities-batch/update-opportunities-batch.mjs
  • components/salesforce_rest_api/actions/create-opportunities-batch/create-opportunities-batch.mjs
  • components/salesforce_rest_api/actions/update-accounts-batch/update-accounts-batch.mjs
  • components/salesforce_rest_api/salesforce_rest_api.app.mjs
  • components/salesforce_rest_api/actions/common/batch-operation.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (5)
components/salesforce_rest_api/actions/list-email-messages/list-email-messages.mjs (1)

7-7: LGTM: version bump only.

No functional changes introduced here.

components/salesforce_rest_api/actions/create-casecomment/create-casecomment.mjs (1)

20-20: LGTM: metadata bump.

No runtime or behavioral changes.

components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs (1)

10-10: LGTM: version bump only.

No functional changes in the source.

components/salesforce_rest_api/actions/add-lead-to-campaign/add-lead-to-campaign.mjs (1)

8-8: LGTM: version bump only.

Action logic unchanged.

components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs (1)

1-21: Solid addition; aligns with Bulk API 2.0 patterns.

getObject/getOperation are correct for Accounts insert; description and metadata look good.

Copy link
Collaborator

@michelle0927 michelle0927 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one comment.

@jcortes jcortes force-pushed the salesforce-accounts-opportunities-batch-create-update branch from 22e4ce2 to e16f354 Compare August 28, 2025 16:50
@jcortes jcortes requested a review from michelle0927 August 28, 2025 16:51
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
components/salesforce_rest_api/actions/create-opportunity/create-opportunity.mjs (3)

43-46: Avoid hard-coding the SObject; use the helper for consistency.
Minor DRY improvement and aligns with other actions.

Apply this diff:

-    const response = await salesforce.createRecord("Opportunity", {
+    const response = await salesforce.createRecord(this.getObjectType(), {

53-53: Harden $summary and standardize capitalization.
Fallback to ID when Name isn’t provided and capitalize “Opportunity”.

Apply this diff:

-    $.export("$summary", `Successfully created opportunity "${this.Name}"`);
+    $.export("$summary", `Successfully created Opportunity "${this.Name || response?.id}"`);

28-43: Remove broad ESLint suppression and destructure only what’s used.
Reduces noise and keeps lint rules effective.

Apply this diff:

-    /* eslint-disable no-unused-vars */
-    const {
-      salesforce,
-      getAdvancedProps,
-      getObjectType,
-      getAdditionalFields,
-      formatDateTimeProps,
-      useAdvancedProps,
-      docsInfo,
-      dateInfo,
-      additionalFields,
-      CloseDate,
-      ...data
-    } = this;
-    /* eslint-enable no-unused-vars */
+    const {
+      salesforce,
+      getAdditionalFields,
+      formatDateTimeProps,
+      CloseDate,
+      ...data
+    } = this;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 22e4ce2 and e16f354.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (55)
  • components/salesforce_rest_api/actions/add-contact-to-campaign/add-contact-to-campaign.mjs (1 hunks)
  • components/salesforce_rest_api/actions/add-lead-to-campaign/add-lead-to-campaign.mjs (1 hunks)
  • components/salesforce_rest_api/actions/common/batch-operation.mjs (1 hunks)
  • components/salesforce_rest_api/actions/convert-soap-xml-to-json/convert-soap-xml-to-json.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-account/create-account.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-attachment/create-attachment.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-campaign/create-campaign.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-case/create-case.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-casecomment/create-casecomment.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-contact/create-contact.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-content-note/create-content-note.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-event/create-event.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-lead/create-lead.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-note/create-note.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-opportunities-batch/create-opportunities-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-opportunity/create-opportunity.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-record/create-record.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-task/create-task.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-user/create-user.mjs (1 hunks)
  • components/salesforce_rest_api/actions/delete-opportunity/delete-opportunity.mjs (1 hunks)
  • components/salesforce_rest_api/actions/delete-record/delete-record.mjs (1 hunks)
  • components/salesforce_rest_api/actions/find-records/find-records.mjs (1 hunks)
  • components/salesforce_rest_api/actions/get-case/get-case.mjs (1 hunks)
  • components/salesforce_rest_api/actions/get-user/get-user.mjs (1 hunks)
  • components/salesforce_rest_api/actions/insert-blob-data/insert-blob-data.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-case-comments/list-case-comments.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-email-messages/list-email-messages.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-email-templates/list-email-templates.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-knowledge-articles/list-knowledge-articles.mjs (1 hunks)
  • components/salesforce_rest_api/actions/post-feed-to-chatter/post-feed-to-chatter.mjs (1 hunks)
  • components/salesforce_rest_api/actions/search-string/search-string.mjs (1 hunks)
  • components/salesforce_rest_api/actions/send-email/send-email.mjs (1 hunks)
  • components/salesforce_rest_api/actions/soql-search/soql-search.mjs (1 hunks)
  • components/salesforce_rest_api/actions/sosl-search/sosl-search.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-account/update-account.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-accounts-batch/update-accounts-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-contact/update-contact.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-email-template/update-email-template.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-opportunities-batch/update-opportunities-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-opportunity/update-opportunity.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-record/update-record.mjs (1 hunks)
  • components/salesforce_rest_api/actions/upsert-record/upsert-record.mjs (1 hunks)
  • components/salesforce_rest_api/package.json (1 hunks)
  • components/salesforce_rest_api/salesforce_rest_api.app.mjs (1 hunks)
  • components/salesforce_rest_api/sources/case-updated-instant/case-updated-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/email-template-updated-instant/email-template-updated-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/knowledge-article-updated-instant/knowledge-article-updated-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-outbound-message/new-outbound-message.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/record-deleted-instant/record-deleted-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/record-updated-instant/record-updated-instant.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (10)
  • components/salesforce_rest_api/actions/list-knowledge-articles/list-knowledge-articles.mjs
  • components/salesforce_rest_api/actions/create-event/create-event.mjs
  • components/salesforce_rest_api/actions/list-email-messages/list-email-messages.mjs
  • components/salesforce_rest_api/actions/search-string/search-string.mjs
  • components/salesforce_rest_api/actions/insert-blob-data/insert-blob-data.mjs
  • components/salesforce_rest_api/actions/create-attachment/create-attachment.mjs
  • components/salesforce_rest_api/actions/add-lead-to-campaign/add-lead-to-campaign.mjs
  • components/salesforce_rest_api/actions/upsert-record/upsert-record.mjs
  • components/salesforce_rest_api/actions/add-contact-to-campaign/add-contact-to-campaign.mjs
  • components/salesforce_rest_api/actions/list-email-templates/list-email-templates.mjs
🚧 Files skipped from review as they are similar to previous changes (42)
  • components/salesforce_rest_api/actions/update-opportunities-batch/update-opportunities-batch.mjs
  • components/salesforce_rest_api/sources/knowledge-article-updated-instant/knowledge-article-updated-instant.mjs
  • components/salesforce_rest_api/actions/create-contact/create-contact.mjs
  • components/salesforce_rest_api/actions/create-record/create-record.mjs
  • components/salesforce_rest_api/actions/get-user/get-user.mjs
  • components/salesforce_rest_api/actions/create-casecomment/create-casecomment.mjs
  • components/salesforce_rest_api/actions/update-account/update-account.mjs
  • components/salesforce_rest_api/sources/email-template-updated-instant/email-template-updated-instant.mjs
  • components/salesforce_rest_api/sources/new-outbound-message/new-outbound-message.mjs
  • components/salesforce_rest_api/actions/sosl-search/sosl-search.mjs
  • components/salesforce_rest_api/actions/update-opportunity/update-opportunity.mjs
  • components/salesforce_rest_api/actions/find-records/find-records.mjs
  • components/salesforce_rest_api/actions/update-record/update-record.mjs
  • components/salesforce_rest_api/sources/record-updated-instant/record-updated-instant.mjs
  • components/salesforce_rest_api/sources/case-updated-instant/case-updated-instant.mjs
  • components/salesforce_rest_api/actions/create-lead/create-lead.mjs
  • components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs
  • components/salesforce_rest_api/actions/update-contact/update-contact.mjs
  • components/salesforce_rest_api/package.json
  • components/salesforce_rest_api/actions/list-case-comments/list-case-comments.mjs
  • components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs
  • components/salesforce_rest_api/actions/delete-opportunity/delete-opportunity.mjs
  • components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs
  • components/salesforce_rest_api/actions/create-case/create-case.mjs
  • components/salesforce_rest_api/actions/create-note/create-note.mjs
  • components/salesforce_rest_api/actions/create-account/create-account.mjs
  • components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs
  • components/salesforce_rest_api/actions/send-email/send-email.mjs
  • components/salesforce_rest_api/actions/create-task/create-task.mjs
  • components/salesforce_rest_api/sources/record-deleted-instant/record-deleted-instant.mjs
  • components/salesforce_rest_api/actions/get-case/get-case.mjs
  • components/salesforce_rest_api/actions/create-user/create-user.mjs
  • components/salesforce_rest_api/actions/soql-search/soql-search.mjs
  • components/salesforce_rest_api/actions/convert-soap-xml-to-json/convert-soap-xml-to-json.mjs
  • components/salesforce_rest_api/salesforce_rest_api.app.mjs
  • components/salesforce_rest_api/actions/post-feed-to-chatter/post-feed-to-chatter.mjs
  • components/salesforce_rest_api/actions/common/batch-operation.mjs
  • components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs
  • components/salesforce_rest_api/actions/create-opportunities-batch/create-opportunities-batch.mjs
  • components/salesforce_rest_api/actions/create-campaign/create-campaign.mjs
  • components/salesforce_rest_api/actions/update-accounts-batch/update-accounts-batch.mjs
  • components/salesforce_rest_api/actions/update-email-template/update-email-template.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (3)
components/salesforce_rest_api/actions/create-opportunity/create-opportunity.mjs (1)

11-11: Patch bump to 0.3.2 looks fine. Please confirm rationale and update release notes if applicable.
No functional changes detected; aligning versions across actions is OK.

components/salesforce_rest_api/actions/delete-record/delete-record.mjs (1)

8-8: Patch version bump only—LGTM. Delete-record v0.2.1, package.json v1.8.0, new batch actions (v0.0.1) all match; Bulk API helpers present.

components/salesforce_rest_api/actions/create-content-note/create-content-note.mjs (1)

30-30: Patch version bump only — LGTM.

No behavioral changes detected; safe to publish as a patch.

michelle0927
michelle0927 previously approved these changes Aug 28, 2025
Copy link
Collaborator

@michelle0927 michelle0927 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jcortes jcortes force-pushed the salesforce-accounts-opportunities-batch-create-update branch from e16f354 to 4d83769 Compare August 29, 2025 14:10
@jcortes jcortes force-pushed the salesforce-accounts-opportunities-batch-create-update branch from 4d83769 to 6cf93ea Compare August 29, 2025 14:12
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/salesforce_rest_api/actions/get-user/get-user.mjs (1)

21-33: Harden against SOQL injection, handle “not found”, and fix summary typo.

userId is interpolated unescaped; validate format to prevent injection and early-fail bad IDs. Also throw if no records are returned. Fix “Sucessfully” → “Successfully”.

Apply this diff:

@@
-  async run({ $ }) {
-    const fields = (await this.salesforce.getFieldsForObjectType("User")).map(({ name }) => name);
-
-    let query = `SELECT ${fields.join(", ")} FROM User WHERE Id = '${this.userId}'`;
-
-    const { records } = await this.salesforce.query({
-      $,
-      query,
-    });
-
-    $.export("$summary", `Sucessfully retrieved user with ID ${this.userId}`);
-    return records[0];
-  },
+  async run({ $ }) {
+    const id = this.userId?.trim();
+    if (!/^[a-zA-Z0-9]{15}(?:[a-zA-Z0-9]{3})?$/.test(id)) {
+      throw new ConfigurationError("Invalid Salesforce ID: expected 15 or 18 alphanumeric characters");
+    }
+
+    const fields = (await this.salesforce.getFieldsForObjectType("User")).map(({ name }) => name);
+    const query = `SELECT ${fields.join(", ")} FROM User WHERE Id = '${id}'`;
+
+    const { records } = await this.salesforce.query({ $, query });
+    if (!records?.length) {
+      throw new ConfigurationError(`User not found: ${id}`);
+    }
+
+    $.export("$summary", `Successfully retrieved user with ID ${id}`);
+    return records[0];
+  },

Add the missing import:

@@
-import salesforce from "../../salesforce_rest_api.app.mjs";
+import salesforce from "../../salesforce_rest_api.app.mjs";
+import { ConfigurationError } from "@pipedream/platform";
🧹 Nitpick comments (2)
components/salesforce_rest_api/actions/create-campaign/create-campaign.mjs (1)

44-56: Use getObjectType() and add a safer summary fallback.

Minor consistency/readability: you already expose getObjectType(); use it instead of hardcoding "Campaign". Also guard the summary when Name is absent.

-    const response = await salesforce.createRecord("Campaign", {
+    const response = await salesforce.createRecord(getObjectType(), {
       $,
       data: {
         ...data,
         ...formatDateTimeProps({
           StartDate,
           EndDate,
         }),
         ...getAdditionalFields(),
       },
     });
-    $.export("$summary", `Successfully created campaign "${this.Name}"`);
+    $.export("$summary", `Successfully created ${getObjectType()} "${this.Name || response?.Name || response?.id}"`);
components/salesforce_rest_api/actions/update-opportunities-batch/update-opportunities-batch.mjs (1)

3-22: Expose waitForCompletion option and poll job until completion
processBulkOperation in actions/common/batch-operation.mjs returns immediately after setting state to UploadComplete. Add an optional waitForCompletion boolean (default false) that, when enabled, polls getBulkJobInfo (with exponential backoff) until job.state is Completed or Failed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e16f354 and 6cf93ea.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (55)
  • components/salesforce_rest_api/actions/add-contact-to-campaign/add-contact-to-campaign.mjs (1 hunks)
  • components/salesforce_rest_api/actions/add-lead-to-campaign/add-lead-to-campaign.mjs (1 hunks)
  • components/salesforce_rest_api/actions/common/batch-operation.mjs (1 hunks)
  • components/salesforce_rest_api/actions/convert-soap-xml-to-json/convert-soap-xml-to-json.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-account/create-account.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-attachment/create-attachment.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-campaign/create-campaign.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-case/create-case.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-casecomment/create-casecomment.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-contact/create-contact.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-content-note/create-content-note.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-event/create-event.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-lead/create-lead.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-note/create-note.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-opportunities-batch/create-opportunities-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-opportunity/create-opportunity.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-record/create-record.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-task/create-task.mjs (1 hunks)
  • components/salesforce_rest_api/actions/create-user/create-user.mjs (1 hunks)
  • components/salesforce_rest_api/actions/delete-opportunity/delete-opportunity.mjs (1 hunks)
  • components/salesforce_rest_api/actions/delete-record/delete-record.mjs (1 hunks)
  • components/salesforce_rest_api/actions/find-records/find-records.mjs (1 hunks)
  • components/salesforce_rest_api/actions/get-case/get-case.mjs (1 hunks)
  • components/salesforce_rest_api/actions/get-user/get-user.mjs (1 hunks)
  • components/salesforce_rest_api/actions/insert-blob-data/insert-blob-data.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-case-comments/list-case-comments.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-email-messages/list-email-messages.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-email-templates/list-email-templates.mjs (1 hunks)
  • components/salesforce_rest_api/actions/list-knowledge-articles/list-knowledge-articles.mjs (1 hunks)
  • components/salesforce_rest_api/actions/post-feed-to-chatter/post-feed-to-chatter.mjs (1 hunks)
  • components/salesforce_rest_api/actions/search-string/search-string.mjs (1 hunks)
  • components/salesforce_rest_api/actions/send-email/send-email.mjs (1 hunks)
  • components/salesforce_rest_api/actions/soql-search/soql-search.mjs (1 hunks)
  • components/salesforce_rest_api/actions/sosl-search/sosl-search.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-account/update-account.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-accounts-batch/update-accounts-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-contact/update-contact.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-email-template/update-email-template.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-opportunities-batch/update-opportunities-batch.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-opportunity/update-opportunity.mjs (1 hunks)
  • components/salesforce_rest_api/actions/update-record/update-record.mjs (1 hunks)
  • components/salesforce_rest_api/actions/upsert-record/upsert-record.mjs (1 hunks)
  • components/salesforce_rest_api/package.json (1 hunks)
  • components/salesforce_rest_api/salesforce_rest_api.app.mjs (1 hunks)
  • components/salesforce_rest_api/sources/case-updated-instant/case-updated-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/email-template-updated-instant/email-template-updated-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/knowledge-article-updated-instant/knowledge-article-updated-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-outbound-message/new-outbound-message.mjs (1 hunks)
  • components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/record-deleted-instant/record-deleted-instant.mjs (1 hunks)
  • components/salesforce_rest_api/sources/record-updated-instant/record-updated-instant.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs
  • components/salesforce_rest_api/sources/knowledge-article-updated-instant/knowledge-article-updated-instant.mjs
  • components/salesforce_rest_api/package.json
  • components/salesforce_rest_api/actions/add-contact-to-campaign/add-contact-to-campaign.mjs
  • components/salesforce_rest_api/actions/create-record/create-record.mjs
🚧 Files skipped from review as they are similar to previous changes (46)
  • components/salesforce_rest_api/actions/update-accounts-batch/update-accounts-batch.mjs
  • components/salesforce_rest_api/actions/create-note/create-note.mjs
  • components/salesforce_rest_api/actions/delete-opportunity/delete-opportunity.mjs
  • components/salesforce_rest_api/actions/list-case-comments/list-case-comments.mjs
  • components/salesforce_rest_api/actions/create-task/create-task.mjs
  • components/salesforce_rest_api/actions/add-lead-to-campaign/add-lead-to-campaign.mjs
  • components/salesforce_rest_api/actions/get-case/get-case.mjs
  • components/salesforce_rest_api/actions/list-knowledge-articles/list-knowledge-articles.mjs
  • components/salesforce_rest_api/actions/search-string/search-string.mjs
  • components/salesforce_rest_api/actions/create-contact/create-contact.mjs
  • components/salesforce_rest_api/actions/insert-blob-data/insert-blob-data.mjs
  • components/salesforce_rest_api/actions/create-event/create-event.mjs
  • components/salesforce_rest_api/sources/record-deleted-instant/record-deleted-instant.mjs
  • components/salesforce_rest_api/actions/sosl-search/sosl-search.mjs
  • components/salesforce_rest_api/actions/update-record/update-record.mjs
  • components/salesforce_rest_api/actions/create-account/create-account.mjs
  • components/salesforce_rest_api/actions/delete-record/delete-record.mjs
  • components/salesforce_rest_api/actions/update-opportunity/update-opportunity.mjs
  • components/salesforce_rest_api/actions/create-opportunity/create-opportunity.mjs
  • components/salesforce_rest_api/actions/create-content-note/create-content-note.mjs
  • components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs
  • components/salesforce_rest_api/sources/email-template-updated-instant/email-template-updated-instant.mjs
  • components/salesforce_rest_api/actions/create-user/create-user.mjs
  • components/salesforce_rest_api/actions/soql-search/soql-search.mjs
  • components/salesforce_rest_api/actions/create-opportunities-batch/create-opportunities-batch.mjs
  • components/salesforce_rest_api/sources/case-updated-instant/case-updated-instant.mjs
  • components/salesforce_rest_api/actions/convert-soap-xml-to-json/convert-soap-xml-to-json.mjs
  • components/salesforce_rest_api/actions/create-lead/create-lead.mjs
  • components/salesforce_rest_api/actions/upsert-record/upsert-record.mjs
  • components/salesforce_rest_api/actions/create-attachment/create-attachment.mjs
  • components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs
  • components/salesforce_rest_api/actions/find-records/find-records.mjs
  • components/salesforce_rest_api/actions/update-account/update-account.mjs
  • components/salesforce_rest_api/actions/list-email-messages/list-email-messages.mjs
  • components/salesforce_rest_api/sources/new-outbound-message/new-outbound-message.mjs
  • components/salesforce_rest_api/actions/common/batch-operation.mjs
  • components/salesforce_rest_api/actions/list-email-templates/list-email-templates.mjs
  • components/salesforce_rest_api/actions/create-casecomment/create-casecomment.mjs
  • components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs
  • components/salesforce_rest_api/actions/update-email-template/update-email-template.mjs
  • components/salesforce_rest_api/actions/post-feed-to-chatter/post-feed-to-chatter.mjs
  • components/salesforce_rest_api/actions/send-email/send-email.mjs
  • components/salesforce_rest_api/actions/create-accounts-batch/create-accounts-batch.mjs
  • components/salesforce_rest_api/actions/create-case/create-case.mjs
  • components/salesforce_rest_api/actions/update-contact/update-contact.mjs
  • components/salesforce_rest_api/salesforce_rest_api.app.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (4)
components/salesforce_rest_api/actions/create-campaign/create-campaign.mjs (1)

11-11: Version bump only — LGTM.

No functional changes here; safe metadata update in line with the broader release.

components/salesforce_rest_api/actions/get-user/get-user.mjs (1)

7-7: Version bump looks fine.

No functional changes introduced here.

components/salesforce_rest_api/sources/record-updated-instant/record-updated-instant.mjs (1)

10-10: Version bump only; OK.

No behavior changes detected.

components/salesforce_rest_api/actions/update-opportunities-batch/update-opportunities-batch.mjs (1)

12-17: LGTM on object/operation wiring.

Correctly targets Opportunity with update.

@jcortes jcortes merged commit 68da7a3 into master Sep 1, 2025
10 checks passed
@jcortes jcortes deleted the salesforce-accounts-opportunities-batch-create-update branch September 1, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ACTION] Salesforce Accounts/Opportunities Batch Create/Update

3 participants